package util{
	
	import mx.containers.TitleWindow;
	import mx.events.CloseEvent;
	
	public class HtmlWindow extends TitleWindow{
		
		/* private var htmlCanvas:HtmlCanvas; */
		
		public function HtmlWindow(){
			
			this.showCloseButton=true;
			this.addEventListener(CloseEvent.CLOSE, onClose);
			this.setVisible(false);
			/* this.x=100;
			this.y=100;
			this.width=1000;
			this.height=800;
			
			var iframe:IFrame=new IFrame();
			this.addChild(iframe);
			iframe.source="http://www.baidu.com/";
			iframe.visible=true; */
			/* htmlCanvas=new HtmlCanvas();
			this.addChild(htmlCanvas);
			
			htmlCanvas.source="http://www.google.com";
						
			htmlCanvas.width=800;
			htmlCanvas.height=700;
			htmlCanvas.x=10;
			htmlCanvas.y=10; */
			
			
			
			
			/* htmlCanvas.visible = true; */
			
		}
		
		private function onClose(e:CloseEvent){
			this.setVisible(false);
			var children:Array=this.getChildren();
			var i:int;
			for(i=0;i<children.length;i++){
				
				IFrame(children[i]).source="";
				IFrame(children[i]).visible=false;
				
			}
		}
		
		/* public function getCavas():HtmlCanvas{
			return this.htmlCanvas;
		} */

	}

}